﻿#pragma once
#include "common.h"
#include "valarray"

class CMatrix
{
	double ** p;
	uint nRow; // к-во строк
	uint nCol; // к-во столбцов

	// Запрет оператора присваивания
	/*void operator = ( const CMatrix & );*/

public:
	uint getRow(){return nRow;}
	uint getCol(){return nCol;}
	void setRow(uint r){nRow=r;}
	void setCol(uint c){nCol=c;}

	CMatrix();
	CMatrix ( unsigned int r, unsigned int c );
	CMatrix ( unsigned int r, unsigned int c, const double * const * a );
	CMatrix ( const CMatrix & );
	~CMatrix ();

	void fill ( double );
	void resize(uint nRow, uint nCol);

	//CMatrix & operator = 
	CMatrix & operator *= ( double );

	operator       double * const * ()       { return p; }
	operator const double * const * () const { return p; }
};
//class CMatrix
//{
//public:
//	CMatrix(size_t rows, size_t cols);
//	double& operator()(size_t i, size_t j);
//	double operator()(size_t i, size_t j) const;
//
//	size_t Rows(){return mRows;}
//	size_t Cols(){return mCols;}
//
//private:
//	size_t mRows;
//	size_t mCols;
//	std::vector<double> mData;
//};
//
//CMatrix::CMatrix(size_t rows, size_t cols)
//	: mRows(rows),
//	mCols(cols),
//	mData(rows * cols)
//{
//}
//
//double& CMatrix::operator()(size_t i, size_t j)
//{
//	return mData[i * mCols + j];
//}
//
//double CMatrix::operator()(size_t i, size_t j) const
//{
//	return mData[i * mCols + j];
//}
